package org.hjj.design.u95.viewer;

import com.google.gson.Gson;
import org.hjj.design.u95.domain.RequestStat;

import java.util.Map;

/**
 * console implementation of {@link StatViewer}
 *
 * @author:何嘉俊
 * @date:2021/5/17
 */
public class ConsoleViewer implements StatViewer {

    @Override
    public void output(Map<String, RequestStat> requestStats, long startTimeInMillis, long endTimeInMillis) {
        System.out.println("Time Span: [" + startTimeInMillis + ", " + endTimeInMillis + "]");
        Gson gson = new Gson();
        System.out.println(gson.toJson(requestStats));
    }
}
